<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>技术支持</title>
    <meta name="keywords" th:content="${companyProfile.seoKeyword}"/>
    <meta name="description" th:content="${companyProfile.seoDescription}"/>
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../static/css/animate.css">
    <link rel="stylesheet" href="../static/css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="../static/css/css.css">
    <link rel="stylesheet" href="../static/css/pagination.css">
    <link rel="stylesheet" href="../static/css/technical.css">
</head>
<body ontouchstart="" data-ind="5">
<style>
    table {
        margin: 0px auto;
    }
</style>
<!--#include file="/public/html/header.html"-->
<div th:replace="header :: header"></div>

<div class="pro_class">
    <div class="wrap clearfix">
        <div class="pro-sidebar wow fadeInLeft_qs50" ms="ms">
            <div class="pro-title">
                <div class="big-title">技术支持</div>
                <div class="small-title">Technical support</div>
            </div>
            <ul class="sub-menu click-sub-menu">
                <li><a href="/technical?type=1"><th:block th:text="${i18n.key27}"></th:block></a></li>
                <li><a href="/technical?type=2"><th:block th:text="${i18n.key28}"></th:block></a></li>
            </ul>
            <div class="pro-title" style="margin-top: 60px;border-radius:10px 10px 0 0;">
                <div class="big-title">咨询客服</div>
                <div class="small-title">Advisory Service</div>
            </div>
            <ul class="sub-menu other-sub-menu">
                <li>
                    <a th:href="'tencent://message/?uin=' + ${companyProfile.qq} + '&Site=在线QQ&Menu=yes'" rel="noopener noreferrer" class="btn rt-btn zx"><img src="/static/image/qq.gif" alt="">客服</a>
                </li>
                <li>
                    <a href="#" style="border-bottom:none;"><img src="/static/image/oclock.png" alt=""><th:block th:text="${i18n.key25}"></th:block></a>
                    <p class="time" style="border-bottom:1px dashed #ddd; padding-bottom:10px;">08:00 - 21:00</p>
                </li>
                <li>
                    <a href="#" style="border-bottom:none;"><img src="/static/image/wechart.png" alt=""><th:block th:text="${i18n.key2}"></th:block> </a>
                    <p class="time">tel: <th:block th:text="${companyProfile.tel}"></th:block></p>
                </li>
            </ul>
        </div>

        <div class="pro-content">
            <div class="content-item nimate__animated animate__fadeIn none">
                <div class="content-title"><span>新闻资讯</span><i>News Information</i></div>
                <ul class="pro-ul clearfix" id="my-news">

                </ul>
            </div>
            <div class="content-item nimate__animated animate__fadeIn none">
                <div class="content-title"><span>资料下载</span><i>Data download</i></div>
                <ul class="pro-ul clearfix" id="my-down">

                </ul>
            </div>
            <div style="text-align: center;">
                <div id="pager" class="pager clearfix">
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="lang" th:value="${session.lang}"/>
<!--#include file="/public/html/footer.html"-->
<div th:replace="footer :: footer"></div>
</body>
<script src="../static/js/swiper-3.4.2.min.js"></script>
<script src="../static/js/jquery-1.11.3.min.js"></script>
<script src="../static/js/wow.min.js"></script>
<script src="../static/js/common.js"></script>
<script src="../static/js/pagination.js"></script>
<script src="../static/js/utils.js"></script>
<script>
    const params = getQueryParams()
    if (params.type == 1) {
        $('.click-sub-menu li').eq(0).find('a').addClass('current-nav')
        $('.content-item').eq(0).removeClass('none')
        queryNews(1, params.type, true);
    } else {
        $('.click-sub-menu li').eq(1).find('a').addClass('current-nav')
        $('.content-item').eq(1).removeClass('none')
        queryDown();
    }

    function currentPage(currentPage) {
        /*
            触发页码数位置： Page/js/jquery.z-pager.js 64行
        */
        console.log("当前页码数：" + currentPage);
        queryNews(currentPage, params.type)
    }
    function queryNews(pageNo, type, initPage){
        $.get('/queryNew', {'pageNo': pageNo, 'type': type}, function(resp){
            console.log(resp);
            var htm = '';
            if(resp.count == 0){
                return;
            }
            var lang = $("#lang").val();
            $.each(resp.data.result, function(i, v){
                htm += `
                <li class="pro-li wow fadeInUp_qs50" ms="ms" >
                    <a href="/news_detail_${v.id}">
                        <div class="news-title">${lang == 'en' ? v.titleEn : v.title}</div>
                        <div class="news-desc">${lang == 'en' ? v.descriptionEn : v.description}</div>
                        <div class="news-bage"><span>${lang == 'en' ? 'News Information' : '公司新闻'}</span></div>
                        <div class="news-time">${v.createtime}</div>
                    </a>
                </li>
                `;
            })

            $('#my-news').html(htm);

            if(initPage == true){
                $("#pager").zPager({
                    totalData: resp.data.count,
                    pageData: 6,
                    htmlBox: $('#wraper'),
                    btnShow: true,
                    ajaxSetData: false
                });
            }
        });
    }

    function queryDown(){
        $.get('/queryDown', function(resp){
            console.log(resp);
            var htm = '';
            if(!resp.data || resp.data == null){
                return;
            }

            $.each(resp.data, function(i, v){
                htm += `
                <li class="pro-li wow fadeInUp_qs50" ms="ms">
                    <div class="download">
                        <span class="name">${v.title}</span>
                        <!--<span class="size">10KB</span>-->
                        <a href="${v.url}" class="btn">download</a>
                    </div>
                </li>
                `;
            })

            $('#my-down').html(htm);
        });
    }

</script>
</html>